;
(function() {
	var BusCon = require("../../core/bus/_con");
	var GoodsCon = require("../../core/goods/_con");
	var TagCon = require("../../core/bus.tag/_con");
	var ResponObj = require("../_include/responObj");
	var role = require("./role");
	module.exports = {
		prefix: "/tag",
		get: {
			"/": function() {
				var query = this.request.query;
				var bus_id = query.bus_id;
				if (!bus_id) {
					throwCusError("参数错误")
				}
				var bus = BusCon.get(bus_id);
				var tags = bus.getTags();
				this.body = ResponObj("json", tags);
			},
			"/detail": function() {
				var query = this.request.query;
				var bus_id = query.bus_id;
				if (!bus_id) {
					throwCusError("参数错误")
				}
				var bus = BusCon.get(bus_id);
				var tags = bus.getTagsDetail(query);
				this.body = ResponObj("json", tags);
			},
			"/detail/by_tag_id": function() {
				var query = this.request.query;
				var bus_id = query.bus_id;
				var tag_id = query.tag_id;
				if (!(bus_id && tag_id)) {
					throwCusError("参数错误")
				}
				var bus = BusCon.get(bus_id);
				this.body = ResponObj("json", bus.getTagsDetailById(tag_id, query))
			},
		},
	}
}());